package com.stox.core.lifecycle;

import javax.swing.SwingUtilities;

import com.stox.core.manager.LifeCycleManager;
import com.stox.core.ui.swing.widget.MainFrame;
import com.stox.ioc.Container;

public class MainClass {

	public static void main(String[] args) {
		Runtime.getRuntime().addShutdownHook(Container.get(ShutdownHook.class));
		Thread.setDefaultUncaughtExceptionHandler(Container.get(StoxUncaughtExceptionHandler.class));
		SwingUtilities.invokeLater(new Runnable(){
			public void run() {
				MainFrame mainFrame = MainFrame.getInstance();
				mainFrame.construct();
				LifeCycleManager lifecycleManager = Container.get(LifeCycleManager.class);
				lifecycleManager.startup();
				mainFrame.setVisible(true);
				lifecycleManager.runAfterUiInitializables();
			}
		});
	}
	

	

}
